<template>
  <div class="app">
    <h1>APP组件</h1>
    <Suspense>
      <template v-slot:default>
        <Child></Child>
      </template>
      <template v-slot:fallback>
        <h2>Loading...</h2>
      </template>
    </Suspense>
  </div>
</template>

<script>
// 静态引入
// import Child from './components/Child';

// 异步引入
import { defineAsyncComponent } from 'vue';
const Child = defineAsyncComponent(() => import('./components/Child'));

export default {
  name: 'App',
  components: { Child },
  setup() {

  }
}
</script>

<style>
.app {
  background-color: gray;
  padding: 20px;
}
</style>
